const express = require('express');

const mysql = require('mysql');
const multer  = require('multer'); //解析上传的文件

let db = mysql.createPool({
    host:'127.0.0.1',user:'root',password:'1q2w3e4R',database:'myproject'
})
const server = express();
let objMulter = multer({dest:'./www/updata/'});//保存到路径

//图片上传
server.use(objMulter.any());//any 处理任何文件

module.exports = function(){ //post
    let router = express.Router();
     router.post(`/files`,(req,res)=>{
             console.log(req,"post")
             console.log(req.files,"post")

    
      })
      return router;
  }